﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DBUtil.FastEntity.Annotations
{

    /// <summary>
    /// 表示一个扩展列映射
    /// </summary>
    [AttributeUsage(AttributeTargets.Property)]
    public class MapExtendColumn_JoinAttribute : Attribute
    {
        /// <summary>
        /// 关联表的映射类型,必填
        /// </summary>
        public Type ExtendTableType { get; set; }

        /// <summary>
        /// 从关联表映射类型的哪个属性中提取值,必填
        /// </summary>
        public string ExtendTableFetchProp { get; set; }

        /// <summary>
        /// 从当前类型的哪个属性值中找相等关系,必填
        /// </summary>
        public string OwnProp { get; set; }

        /// <summary>
        /// 从关联表映射类型的哪个属性中找相等关系,默认主键
        /// </summary>
        public string ExtendTableCompareProp { get; set; }

        /// <summary>
        /// 组合的字符串,默认:"逗号"
        /// </summary>
        public string JoinString { get; set; } = ",";
    }
}
